package com.dzqc.fly.service.impl;

import com.dzqc.fly.common.PageUtils;
import com.dzqc.fly.db.dao.AppTeacherDao;
import com.dzqc.fly.service.AppTeacherService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedList;


@Service
public class AppTeacherServiceimpl implements AppTeacherService {

    @Autowired
    private AppTeacherDao teacherDao;


    @Override
    public PageUtils searchIndexDataOfTeacher(HashMap param) {
        LinkedList<HashMap> list=teacherDao.searchIndexDataOfTeacher(param);
        long count=teacherDao.searchIndexDataCount(param);
        int start=(Integer) param.get("start");
        int length=(Integer) param.get("length");
        PageUtils pageUtils=new PageUtils(list,count,start,length);
        return pageUtils;
    }

    @Override
    public HashMap getLeaveDetails(HashMap param) {
        return teacherDao.getLeaveDetails(param);
    }

    @Override
    public LinkedList<HashMap> getLeaveDetailFiles(HashMap param) {
        return teacherDao.getLeaveDetailFiles(param);
    }

    @Override
    public int updateLeave(HashMap param) {
        return teacherDao.updateLeave(param);
    }

    @Override
    public int updateLeaveshenpi(HashMap param) {
        return teacherDao.updateLeaveshenpi(param);
    }

    @Override
    public PageUtils getLeaveTeacherhandling(HashMap param) {
        ArrayList<HashMap> list=teacherDao.getLeaveTeacherhandling(param);
        long count=teacherDao.getLeaveTeacherhandlingCount(param);
        int start=(Integer) param.get("start");
        int length=(Integer) param.get("length");
        PageUtils pageUtils=new PageUtils(list,count,start,length);
        return pageUtils;

    }

    @Override
    public PageUtils getLeaveingTeacherDataDetails(HashMap param) {
        ArrayList<HashMap> list=teacherDao.getLeaveingTeacherDataDetails(param);
        long count=teacherDao.getLeaveingTeacherDataDetailsCount(param);
        int start=(Integer) param.get("start");
        int length=(Integer) param.get("length");
        PageUtils pageUtils=new PageUtils(list,count,start,length);
        return pageUtils;
    }

    @Override
    public PageUtils getLeaveFinishedTeacherDataDetails(HashMap param) {
        ArrayList<HashMap> list=teacherDao.getLeaveFinishedTeacherDataDetails(param);
        long count=teacherDao.getLeaveFinishedTeacherDataDetailsCount(param);
        int start=(Integer) param.get("start");
        int length=(Integer) param.get("length");
        PageUtils pageUtils=new PageUtils(list,count,start,length);
        return pageUtils;
    }

    @Override
    public LinkedList<HashMap> getclassNameOfTeacherStatistics(HashMap param) {
        return teacherDao.getclassNameOfTeacherStatistics(param);
    }

    @Override
    public LinkedList<HashMap> getLeaveAllStudentOfTeacherStatistics(HashMap param) {
        return teacherDao.getLeaveAllStudentOfTeacherStatistics(param);
    }

    @Override
    public LinkedList<HashMap> getLeaveOneStudentOfTeacherStatistics(HashMap param) {
        return teacherDao.getLeaveOneStudentOfTeacherStatistics(param);
    }

    @Override
    public long getSumOfStudentLeaveHours(HashMap param) {
        return teacherDao.getSumOfStudentLeaveHours(param);
    }

    @Override
    public LinkedList<HashMap> getMonthOfTeacher(int fdyid) {
        return teacherDao.getMonthOfTeacher(fdyid);
    }

    @Override
    public LinkedList<HashMap> getLeaveList(HashMap param) {
        return teacherDao.getLeaveList(param);
    }

    @Override
    public HashMap getStudentInfo(HashMap param) {
        return teacherDao.getStudentInfo(param);
    }

    @Override
    public long searchTotalhours(HashMap param) {
        return teacherDao.searchTotalhours(param);
    }


}
